package com.aimusic.Exception;

import com.aimusic.enums.ErrorCode;

/**
 * 自定义业务异常类
 */
public class BusinessException extends RuntimeException {
    // 错误码
    private int code;

    public BusinessException(int code, String message) {
        super(message);
        this.code = code;
    }

    public BusinessException(ErrorCode errorCode) {
        super(errorCode.getMessage());
        this.code = errorCode.getCode();
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
    